<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<meta charset="utf-8">
<head>
    <link type="text/css" href="${pageContext.request.contextPath}/css/booksDetails.css" rel="stylesheet">
   <title>图书详情</title>
    <script type="text/javascript"src="${pageContext.request.contextPath}/scripts/jquery-3.2.1.js"></script>
    <script type="text/javascript">
        $(function () {
            $("[type=image]").click(function () {
                $.ajax({
                    type:"post",
                    url:"/login/cartServlet",
                    data:{
                        "doType":"doInsert",
                        "bookId":"${bookDetails[0].bookId}",
                        "book":"${bookDetails[0].book}",
                        "cover":"${bookDetails[0].cover}",
                        "pricing":"${bookDetails[0].pricing}",
                        "price":"${bookDetails[0].price}",
                        "number":1
                    },
                    success:function (data) {
                        alert(data)
                    }
                })
            })
        })
    </script>
</head>
<body >
    <div id="container" align="center">
        <!--页面头部栏-->
        <div id="head">
            <iframe src="${pageContext.request.contextPath}/head.jsp" width="100%" height="100%" scrolling="no" frameborder="0">
            </iframe>
        </div>

        <!--页面购物车栏-->
        <div id="center">
            <c:forEach items="${bookDetails}" var="book">
                <div id="book">
                    <div id="bookName">
                        <h3>${book.book}</h3>
                        丛书名：${book.book}
                    </div>
                    <div id="message">
                        <img src="${pageContext.request.contextPath}/${book.cover}">
                        <ul id="ul1">
                            <li>作者:${book.writer}</li>
                            <li>出版社:${book.press}</li>
                            <li>出版时间:${book.publicationTime}</li>
                            <li>版次:${book.print+2}</li>
                            <li>印刷时间:${book.printingTime}</li>
                            <li>印次:${book.print}</li>
                            <li>ISBN:${book.ISBN}</li>
                            <li>定价:${book.pricing}<span style="color: red">&nbsp&nbsp&nbsp&nbsp&nbsp当当价：￥${book.price}
                            </span>&nbsp&nbsp&nbsp&nbsp&nbsp节省：￥${book.pricing-book.price}</li>
                            <li>库存:${book.repertory}</li>
                        </ul>
                        <ul id="ul2">
                            <li>字数:${book.words}</li>
                            <li>页数:${book.pages}</li>
                            <li>开本:${book.format}</li>
                            <li>纸张:${book.sheet}</li>
                            <li>包装:${book.pack}</li>
                        </ul>
                        <input type="image" src="${pageContext.request.contextPath}/images/goumai.png" id="input">
                    </div>

                    <div id="contentDetails">
                        <div id="contentSynopsis">
                            <h3>内容简介</h3>
                                ${book.contentIntro}
                        </div>

                        <div id="writerSynopsis">
                            <h3>作者简介</h3>
                                ${book.writerIntro}
                        </div>

                        <div id="catalogue">
                            <h3>目录</h3>
                                ${book.catalog}
                        </div>

                        <div id="comment ">
                            <h3>媒体评论</h3>
                                ${book.mediaComments}
                        </div>

                        <div id="digest ">
                            <h3>书摘插图</h3>
                                ${book.excerpt}
                        </div>
                    </div>
                </div>
            </c:forEach>
        </div>

        <!--页面脚注栏-->
        <div id="foot">
            <iframe src="${pageContext.request.contextPath}/foot.jsp" width="100%" height="100%" scrolling="no" frameborder="0">
            </iframe>
        </div>
    </div>
</body>
</html>
